/*
 * XML Type:  Income
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.Income
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML Income(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class IncomeImpl extends net.ofx.types.x2003.x04.impl.AbstractInvestmentTransactionImpl implements net.ofx.types.x2003.x04.Income
{
    
    public IncomeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName SECID$0 = 
        new javax.xml.namespace.QName("", "SECID");
    private static final javax.xml.namespace.QName INCOMETYPE$2 = 
        new javax.xml.namespace.QName("", "INCOMETYPE");
    private static final javax.xml.namespace.QName TOTAL$4 = 
        new javax.xml.namespace.QName("", "TOTAL");
    private static final javax.xml.namespace.QName SUBACCTSEC$6 = 
        new javax.xml.namespace.QName("", "SUBACCTSEC");
    private static final javax.xml.namespace.QName SUBACCTFUND$8 = 
        new javax.xml.namespace.QName("", "SUBACCTFUND");
    private static final javax.xml.namespace.QName TAXEXEMPT$10 = 
        new javax.xml.namespace.QName("", "TAXEXEMPT");
    private static final javax.xml.namespace.QName WITHHOLDING$12 = 
        new javax.xml.namespace.QName("", "WITHHOLDING");
    private static final javax.xml.namespace.QName CURRENCY$14 = 
        new javax.xml.namespace.QName("", "CURRENCY");
    private static final javax.xml.namespace.QName ORIGCURRENCY$16 = 
        new javax.xml.namespace.QName("", "ORIGCURRENCY");
    private static final javax.xml.namespace.QName INV401KSOURCE$18 = 
        new javax.xml.namespace.QName("", "INV401KSOURCE");
    
    
    /**
     * Gets the "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId getSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * Sets the "SECID" element
     */
    public void setSECID(net.ofx.types.x2003.x04.SecurityId secid)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().find_element_user(SECID$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            }
            target.set(secid);
        }
    }
    
    /**
     * Appends and returns a new empty "SECID" element
     */
    public net.ofx.types.x2003.x04.SecurityId addNewSECID()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SecurityId target = null;
            target = (net.ofx.types.x2003.x04.SecurityId)get_store().add_element_user(SECID$0);
            return target;
        }
    }
    
    /**
     * Gets the "INCOMETYPE" element
     */
    public net.ofx.types.x2003.x04.IncomeEnum.Enum getINCOMETYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INCOMETYPE$2, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.IncomeEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "INCOMETYPE" element
     */
    public net.ofx.types.x2003.x04.IncomeEnum xgetINCOMETYPE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IncomeEnum target = null;
            target = (net.ofx.types.x2003.x04.IncomeEnum)get_store().find_element_user(INCOMETYPE$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "INCOMETYPE" element
     */
    public void setINCOMETYPE(net.ofx.types.x2003.x04.IncomeEnum.Enum incometype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INCOMETYPE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INCOMETYPE$2);
            }
            target.setEnumValue(incometype);
        }
    }
    
    /**
     * Sets (as xml) the "INCOMETYPE" element
     */
    public void xsetINCOMETYPE(net.ofx.types.x2003.x04.IncomeEnum incometype)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.IncomeEnum target = null;
            target = (net.ofx.types.x2003.x04.IncomeEnum)get_store().find_element_user(INCOMETYPE$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.IncomeEnum)get_store().add_element_user(INCOMETYPE$2);
            }
            target.set(incometype);
        }
    }
    
    /**
     * Gets the "TOTAL" element
     */
    public java.lang.String getTOTAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOTAL$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "TOTAL" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetTOTAL()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(TOTAL$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "TOTAL" element
     */
    public void setTOTAL(java.lang.String total)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TOTAL$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TOTAL$4);
            }
            target.setStringValue(total);
        }
    }
    
    /**
     * Sets (as xml) the "TOTAL" element
     */
    public void xsetTOTAL(net.ofx.types.x2003.x04.AmountType total)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(TOTAL$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(TOTAL$4);
            }
            target.set(total);
        }
    }
    
    /**
     * Gets the "SUBACCTSEC" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum.Enum getSUBACCTSEC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTSEC$6, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.SubAccountEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "SUBACCTSEC" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum xgetSUBACCTSEC()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTSEC$6, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SUBACCTSEC" element
     */
    public void setSUBACCTSEC(net.ofx.types.x2003.x04.SubAccountEnum.Enum subacctsec)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTSEC$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SUBACCTSEC$6);
            }
            target.setEnumValue(subacctsec);
        }
    }
    
    /**
     * Sets (as xml) the "SUBACCTSEC" element
     */
    public void xsetSUBACCTSEC(net.ofx.types.x2003.x04.SubAccountEnum subacctsec)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTSEC$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().add_element_user(SUBACCTSEC$6);
            }
            target.set(subacctsec);
        }
    }
    
    /**
     * Gets the "SUBACCTFUND" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum.Enum getSUBACCTFUND()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTFUND$8, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.SubAccountEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "SUBACCTFUND" element
     */
    public net.ofx.types.x2003.x04.SubAccountEnum xgetSUBACCTFUND()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTFUND$8, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SUBACCTFUND" element
     */
    public void setSUBACCTFUND(net.ofx.types.x2003.x04.SubAccountEnum.Enum subacctfund)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SUBACCTFUND$8, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SUBACCTFUND$8);
            }
            target.setEnumValue(subacctfund);
        }
    }
    
    /**
     * Sets (as xml) the "SUBACCTFUND" element
     */
    public void xsetSUBACCTFUND(net.ofx.types.x2003.x04.SubAccountEnum subacctfund)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.SubAccountEnum target = null;
            target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().find_element_user(SUBACCTFUND$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.SubAccountEnum)get_store().add_element_user(SUBACCTFUND$8);
            }
            target.set(subacctfund);
        }
    }
    
    /**
     * Gets the "TAXEXEMPT" element
     */
    public net.ofx.types.x2003.x04.BooleanType.Enum getTAXEXEMPT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TAXEXEMPT$10, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.BooleanType.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "TAXEXEMPT" element
     */
    public net.ofx.types.x2003.x04.BooleanType xgetTAXEXEMPT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(TAXEXEMPT$10, 0);
            return target;
        }
    }
    
    /**
     * True if has "TAXEXEMPT" element
     */
    public boolean isSetTAXEXEMPT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TAXEXEMPT$10) != 0;
        }
    }
    
    /**
     * Sets the "TAXEXEMPT" element
     */
    public void setTAXEXEMPT(net.ofx.types.x2003.x04.BooleanType.Enum taxexempt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TAXEXEMPT$10, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TAXEXEMPT$10);
            }
            target.setEnumValue(taxexempt);
        }
    }
    
    /**
     * Sets (as xml) the "TAXEXEMPT" element
     */
    public void xsetTAXEXEMPT(net.ofx.types.x2003.x04.BooleanType taxexempt)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BooleanType target = null;
            target = (net.ofx.types.x2003.x04.BooleanType)get_store().find_element_user(TAXEXEMPT$10, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BooleanType)get_store().add_element_user(TAXEXEMPT$10);
            }
            target.set(taxexempt);
        }
    }
    
    /**
     * Unsets the "TAXEXEMPT" element
     */
    public void unsetTAXEXEMPT()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TAXEXEMPT$10, 0);
        }
    }
    
    /**
     * Gets the "WITHHOLDING" element
     */
    public java.lang.String getWITHHOLDING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(WITHHOLDING$12, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "WITHHOLDING" element
     */
    public net.ofx.types.x2003.x04.PositiveAmountType xgetWITHHOLDING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositiveAmountType target = null;
            target = (net.ofx.types.x2003.x04.PositiveAmountType)get_store().find_element_user(WITHHOLDING$12, 0);
            return target;
        }
    }
    
    /**
     * True if has "WITHHOLDING" element
     */
    public boolean isSetWITHHOLDING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(WITHHOLDING$12) != 0;
        }
    }
    
    /**
     * Sets the "WITHHOLDING" element
     */
    public void setWITHHOLDING(java.lang.String withholding)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(WITHHOLDING$12, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(WITHHOLDING$12);
            }
            target.setStringValue(withholding);
        }
    }
    
    /**
     * Sets (as xml) the "WITHHOLDING" element
     */
    public void xsetWITHHOLDING(net.ofx.types.x2003.x04.PositiveAmountType withholding)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.PositiveAmountType target = null;
            target = (net.ofx.types.x2003.x04.PositiveAmountType)get_store().find_element_user(WITHHOLDING$12, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.PositiveAmountType)get_store().add_element_user(WITHHOLDING$12);
            }
            target.set(withholding);
        }
    }
    
    /**
     * Unsets the "WITHHOLDING" element
     */
    public void unsetWITHHOLDING()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(WITHHOLDING$12, 0);
        }
    }
    
    /**
     * Gets the "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$14, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "CURRENCY" element
     */
    public boolean isSetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(CURRENCY$14) != 0;
        }
    }
    
    /**
     * Sets the "CURRENCY" element
     */
    public void setCURRENCY(net.ofx.types.x2003.x04.Currency currency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(CURRENCY$14, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$14);
            }
            target.set(currency);
        }
    }
    
    /**
     * Appends and returns a new empty "CURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(CURRENCY$14);
            return target;
        }
    }
    
    /**
     * Unsets the "CURRENCY" element
     */
    public void unsetCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(CURRENCY$14, 0);
        }
    }
    
    /**
     * Gets the "ORIGCURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency getORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(ORIGCURRENCY$16, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ORIGCURRENCY" element
     */
    public boolean isSetORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(ORIGCURRENCY$16) != 0;
        }
    }
    
    /**
     * Sets the "ORIGCURRENCY" element
     */
    public void setORIGCURRENCY(net.ofx.types.x2003.x04.Currency origcurrency)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().find_element_user(ORIGCURRENCY$16, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(ORIGCURRENCY$16);
            }
            target.set(origcurrency);
        }
    }
    
    /**
     * Appends and returns a new empty "ORIGCURRENCY" element
     */
    public net.ofx.types.x2003.x04.Currency addNewORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Currency target = null;
            target = (net.ofx.types.x2003.x04.Currency)get_store().add_element_user(ORIGCURRENCY$16);
            return target;
        }
    }
    
    /**
     * Unsets the "ORIGCURRENCY" element
     */
    public void unsetORIGCURRENCY()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(ORIGCURRENCY$16, 0);
        }
    }
    
    /**
     * Gets the "INV401KSOURCE" element
     */
    public net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum getINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                return null;
            }
            return (net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "INV401KSOURCE" element
     */
    public net.ofx.types.x2003.x04.Investment401KSourceEnum xgetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Investment401KSourceEnum target = null;
            target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().find_element_user(INV401KSOURCE$18, 0);
            return target;
        }
    }
    
    /**
     * True if has "INV401KSOURCE" element
     */
    public boolean isSetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(INV401KSOURCE$18) != 0;
        }
    }
    
    /**
     * Sets the "INV401KSOURCE" element
     */
    public void setINV401KSOURCE(net.ofx.types.x2003.x04.Investment401KSourceEnum.Enum inv401KSOURCE)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(INV401KSOURCE$18);
            }
            target.setEnumValue(inv401KSOURCE);
        }
    }
    
    /**
     * Sets (as xml) the "INV401KSOURCE" element
     */
    public void xsetINV401KSOURCE(net.ofx.types.x2003.x04.Investment401KSourceEnum inv401KSOURCE)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.Investment401KSourceEnum target = null;
            target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().find_element_user(INV401KSOURCE$18, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.Investment401KSourceEnum)get_store().add_element_user(INV401KSOURCE$18);
            }
            target.set(inv401KSOURCE);
        }
    }
    
    /**
     * Unsets the "INV401KSOURCE" element
     */
    public void unsetINV401KSOURCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(INV401KSOURCE$18, 0);
        }
    }
}
